<script setup lang="ts">
  import UseMqtt from './UseMqtt';
 
  const {
    startMqtt,
    addLink
  } = UseMqtt();
 
 // 创建一个连接
 startMqtt("A", (topic, data) => {
    console.log(topic);
    console.log(data);
 });
 
 // 订阅多主题
 addLink('a001');
 addLink('a002');
</script>